<template>
  <div>
    <el-card>
      <div slot="header" class="clearfix">
      </div>
<el-row>
        <el-col :span="16">
          <!-- 表单 -->
          <el-form label-width="120px" >
            <el-form-item label="编号：">
              <!-- {{articles[0].id}} -->
              1
            </el-form-item>
            <el-form-item label="手机：">
              <!-- {{articles[0].username}} -->
              admin
            </el-form-item>
            <el-form-item label="密码：">
              <!-- {{articles[0].password}} -->
              admin
            </el-form-item>
            <el-form-item label="联系邮箱：">
              <el-input  placeholder="null"></el-input>
            </el-form-item>
            <el-form-item>
              <el-button @click="doSave" type="primary">保存设置</el-button>
            </el-form-item>
          </el-form>
        </el-col>
      </el-row>
    </el-card>
  </div>
</template>
<script>
export default {
  name: 'setting',
  data () {
    return {
      imageUrl: '',
      articles: []
    }
  },
  created () {
    this.loadUserInfo()
  },
  methods: {
    // 获取用户资料
    async loadUserInfo () {
      this.$http.get('http://localhost:3000/admin').then((res) => {
        console.log(res)
        this.articles = res.body
      })
    },
    doSave () {
      console.log('保存成功')
      console.log(this.articles)
    }
  },
  mounted () {
  }
}
</script>

<style lang="less" scoped>
.avatar-uploader {
    text-align: center;
  }
  .avatar{
    width: 300px;
  }
  .avatar-uploader-icon {
    font-size: 28px;
    color: #8c939d;
    width: 178px;
    height: 178px;
    line-height: 178px;
    text-align: center;
  }
  .avatar-uploader /deep/ .el-upload {
    border: 1px dashed #d9d9d9;
    border-radius: 6px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
  }
    .head{
          width: 100%;
      height: 30px;
            line-height: 30px;
  }
</style>
